<?php

namespace App\Http\Controllers\Applet\Sponsor;

use App\Services\Applet\Sponsor\CategoryService;
use Exception;
use Illuminate\Http\JsonResponse;

class CategoryController extends BaseSponsorController
{

    protected CategoryService $categoryService;

    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct();
        $this->categoryService = $this->loadService('Applet\Sponsor\CategoryService');
    }

    /**
     * 分类列表
     * @return JsonResponse
     * @throws Exception
     */
    public function list(): JsonResponse
    {

        $list = $this->categoryService->list($this->params);
        return outputJsonResult($list);
    }
}
